// (c) 2007 Messaging Logic. All Rights Reserved.
package org.xi8ix.jms;

import java.util.Enumeration;
import java.util.Iterator;

/**
 * @author Iain Shigeoka
 */
public class IteratorEnumerator<T> implements Enumeration {

    private Iterator<T> iterator;

    public IteratorEnumerator(Iterator<T> iterator) {
        this.iterator = iterator;
    }

    public boolean hasMoreElements() {
        return iterator.hasNext();
    }

    public T nextElement() {
        return iterator.next();
    }
}
